How can I create functions to extract average and count from the given data objects

welcome to shbcf.ru